package com.example.common.api;

import com.example.common.entity.ResultMessage;
import com.example.common.entity.Token;

/**
 * @author kangshuai
 */
public interface UserService {

    /**
     * 用户注册
     *
     * @param email
     * @param passwd
     * @param authCode
     * @return
     * @throws Exception
     */
    ResultMessage<Boolean> register(String email, String passwd, String authCode) throws Exception;

    /**
     * 判断用户是否存在
     *
     * @param email
     * @return
     * @throws Exception
     */
    Boolean isRegister(String email) throws Exception;

    /**
     * 用户登录
     *
     * @param email
     * @param passwd
     * @return
     * @throws Exception
     */
    Token login(String email, String passwd) throws Exception;

    /**
     * 根据token获取用户信息
     *
     * @param token
     * @return
     * @throws Exception
     */
    String getInfoByToken(String token) throws Exception;
}
